package com.example.moneybook.controller;

import com.example.moneybook.dto.ResponseResult;
import com.example.moneybook.service.StatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;

/**
 * @Author: 包
 * @Date: 2023/2/18 20:08
 * Description:
 */

@RestController
@RequestMapping("/statistics")
public class StatisticsController {

    @Autowired
    private StatisticsService statisticsService;

    @PostMapping("/statisticsLoad")
    public ResponseResult statisticsLoad(String userId, String billDate, int state) throws ParseException {
        return statisticsService.statisticsLoad(userId, billDate, state);
    }

    @PostMapping("/billByType")
    public ResponseResult billByType(String userId, String billDate, String billType, int sortType, int state){
        return statisticsService.billByType(userId, billDate, billType, sortType, state);
    }
}
